package 
{
	import atom.Atom;
	import atom.net.Link;
	import atom.message.Message;
	import atom.scenarios.Scenario1;
	import atom.scenarios.Scenario2;
	import atom.scenarios.Scenario3;
	import atom.scenarios.Scenario4;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import net.hires.debug.Stats;
	
	[SWF(backgroundColor="0xEEEEEE")]
	
	/**
	 * ...
	 * @author Jorge Braccini
	 */
	public class Main extends Sprite {
		
		private var connection:Link;
		
		public function Main():void {
			if (stage)  init();
			else 		addEventListener(Event.INIT, init);
		}
		
		private function init(e:Event = null) :void {
			removeEventListener(Event.INIT, init);
			
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			
			Atom.onReady = handleReady;
			Atom.initialize(this);
			
			handleReady();
			
		}
		
		private function handleReady():void {
			addChild(new Scenario4());
			//addChild(new Scenario3());
			//addChild(new Scenario2());
			//addChild(new Stats());
		}
		
	}
	
}